package com.hspedu.enum_;

/**
 * @author DL5O
 * @version 1.0
 */
public class Enumeration03 {
    public static void main(String[] args) {
        System.out.println(Season2.SPRING);
        System.out.println(Season2.SUMMER);
    }
}

enum Season2{

    //使用enum 来实现枚举类
    //1. 使用关键字 enum 替代 class
    //2. public final static Season_ SPRING = new Season_("春天", "温暖");
    //   直接使用 SPRING("春天","温暖"); 进行替代 常量名(实参列表) 等价了前面这句话
    //3. 如果有多个常量(对象),使用 "," 间隔即可
    //4. 如果使用enum 来实现枚举，要求将定义常量写在最前面
    //5. 如果我们使用的是无参构造器，创建常量对象，则可以省略()
    SPRING("春天","温暖"), WINTER("冬天","寒冷"),
    AUTUMN("秋天","凉爽"),SUMMER("夏天","炎热"),
    What;


    private String name;
    private String desc;//描述

    private Season2() {
    }

    private Season2(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }


    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public String toString() {
        return "Season_{" +
                "name='" + name + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }
}
